_rrrr_eeee_aaaa_dddd attempts to read _n_b_y_t_e bytes from the file associated with _f_i_l_d_e_s
into the buffer pointed to by _b_u_f. If _n_b_y_t_e is zero, _rrrr_eeee_aaaa_dddd returns zero
and has no other results. _f_i_l_d_e_s is a file descriptor obtained from a
_cccc_rrrr_eeee_aaaa_tttt, _oooo_pppp_eeee_nnnn, _dddd_uuuu_pppp, _ffff_cccc_nnnn_tttt_llll, _pppp_iiii_pppp_eeee, or _iiii_oooo_cccc_tttt_llll system call.
On devices capable of seeking, the _rrrr_eeee_aaaa_dddd starts at a position in the file
given by the file pointer associated with _f_i_l_d_e_s. On return from _rrrr_eeee_aaaa_dddd,
the file pointer is incremented by the number of bytes actually read.
Devices that are incapable of seeking always read from the current
position. The value of a file pointer associated with such a file is
undefined.
_pppp_rrrr_eeee_aaaa_dddd and _pppp_rrrr_eeee_aaaa_dddd_6666_4444 are the same as _rrrr_eeee_aaaa_dddd except that they do the equivalent
of an _llll_ssss_eeee_eeee_kkkk (for _pppp_rrrr_eeee_aaaa_dddd) or _llll_ssss_eeee_eeee_kkkk_6666_4444 (for _pppp_rrrr_eeee_aaaa_dddd_6666_4444) _o_f_f_s_e_t bytes with the
_w_h_e_n_c_e set to _SSSS_EEEE_EEEE_KKKK______SSSS_EEEE_TTTT before reading. On return from _pppp_rrrr_eeee_aaaa_dddd or _pppp_rrrr_eeee_aaaa_dddd_6666_4444,
the file pointer is unchanged. If _ffff_iiii_llll_dddd_eeee_ssss refers to a file incapable of
seeking (a fifo or socket) then an error is returned and _eeee_rrrr_rrrr_nnnn_oooo will be
set to _EEEE_SSSS_PPPP_IIII_PPPP_EEEE.
_rrrr_eeee_aaaa_dddd_vvvv performs the same action as _rrrr_eeee_aaaa_dddd, but places the input data into
the _i_o_v_c_n_t buffers specified by the members of the _i_o_v array: _i_o_v[0],
_i_o_v[1], ..., _i_o_v[_i_o_v_c_n_t-1].
For _rrrr_eeee_aaaa_dddd_vvvv, the _iiii_oooo_vvvv_eeee_cccc structure contains the following members:
file, or the system call was interrupted. When end-of-file has been
reached, read will return a value of 0. A value greater than 0, but less
than _n_b_y_t_e , should not be construed as implying end-of-file, because
many devices and even filesystems can return short counts for various
reasons.
_rrrr_eeee_aaaa_dddd reads data previously written to a file. If any portion of an
ordinary file prior to the end of file has not been written, _rrrr_eeee_aaaa_dddd returns
the number of bytes read as _0000. For example, the _llll_ssss_eeee_eeee_kkkk routine allows the
file pointer to be set beyond the end of existing data in the file. If
additional data is written at this point, subsequent reads in the gap
between the previous end of data and newly written data return bytes with
a value of _0000 until data is written into the gap.
When attempting to _rrrr_eeee_aaaa_dddd from a file with _OOOO______DDDD_IIII_RRRR_EEEE_CCCC_TTTT or _FFFF_DDDD_IIII_RRRR_EEEE_CCCC_TTTT set, -1 will
be returned and _eeee_rrrr_rrrr_nnnn_oooo will be set to _EEEE_IIII_NNNN_VVVV_AAAA_LLLL if _nnnn_bbbb_yyyy_tttt_eeee or the current file
position is not a multiple of the underlying device's blocksize, _n_b_y_t_e is
too big or _b_u_f isn't properly aligned. See also _FFFF______DDDD_IIII_OOOO_IIII_NNNN_FFFF_OOOO in the
_ffff_cccc_nnnn_tttt_llll(2) manual entry.
When attempting to _rrrr_eeee_aaaa_dddd from a file with _OOOO______RRRR_SSSS_YYYY_NNNN_CCCC and _OOOO______SSSS_YYYY_NNNN_CCCC set, the read
will will wait to return until both the file data and file status to be
physically updated. When attempting to _rrrr_eeee_aaaa_dddd from a file with _OOOO______RRRR_SSSS_YYYY_NNNN_CCCC and
_OOOO______DDDD_SSSS_YYYY_NNNN_CCCC set, the read will will wait to return until the file data has
been physically updated.
A _rrrr_eeee_aaaa_dddd or _rrrr_eeee_aaaa_dddd_vvvv from a STREAMS [see _iiii_nnnn_tttt_rrrr_oooo(2)] file can operate in three
different modes: byte-stream mode, message-nondiscard mode, and message-
discard mode. The default is byte-stream mode. This can be changed
using the _IIII______SSSS_RRRR_DDDD_OOOO_PPPP_TTTT _iiii_oooo_cccc_tttt_llll(2) request [see _ssss_tttt_rrrr_eeee_aaaa_mmmm_iiii_oooo(7)], and can be tested
with the _IIII______GGGG_RRRR_DDDD_OOOO_PPPP_TTTT _iiii_oooo_cccc_tttt_llll(2) request. In byte-stream mode, _rrrr_eeee_aaaa_dddd and _rrrr_eeee_aaaa_dddd_vvvv
usually retrieve data from the stream until they have retrieved _n_b_y_t_e
bytes, or until there
is no more data to be retrieved. Byte-stream mode usually ignores
message boundaries.
In STREAMS message-nondiscard mode, _rrrr_eeee_aaaa_dddd and _rrrr_eeee_aaaa_dddd_vvvv retrieve data until
they have read _n_b_y_t_e bytes, or until they reach a message boundary. If
_rrrr_eeee_aaaa_dddd or _rrrr_eeee_aaaa_dddd_vvvv does not retrieve all the data in a message, the remaining
data is replaced on the stream and can be retrieved by the next _rrrr_eeee_aaaa_dddd or
_rrrr_eeee_aaaa_dddd_vvvv call. Message-discard mode also retrieves data until it has
retrieved _n_b_y_t_e bytes, or it reaches a message boundary. However, unread
data remaining in a message after the _rrrr_eeee_aaaa_dddd or _rrrr_eeee_aaaa_dddd_vvvv returns is discarded,
and is not available for a subsequent _rrrr_eeee_aaaa_dddd, _rrrr_eeee_aaaa_dddd_vvvv, or _gggg_eeee_tttt_mmmm_ssss_gggg [see
_gggg_eeee_tttt_mmmm_ssss_gggg(2)].
When attempting to read from a regular file with mandatory file/record
locking set [see _cccc_hhhh_mmmm_oooo_dddd(2)], and there is a write lock owned by another
If _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY or _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK is set, _rrrr_eeee_aaaa_dddd returns -1 and sets _eeee_rrrr_rrrr_nnnn_oooo to
_EEEE_AAAA_GGGG_AAAA_IIII_NNNN.
If _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY and _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK are clear, _rrrr_eeee_aaaa_dddd sleeps until the blocking
record lock is removed.
When attempting to read from an empty pipe (or FIFO):
If no process has the pipe open for writing, _rrrr_eeee_aaaa_dddd returns 0 to
indicate end-of-file.
If some process has the pipe open for writing and _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY is set,
_rrrr_eeee_aaaa_dddd returns 0.
If some process has the pipe open for writing and _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK is set,
_rrrr_eeee_aaaa_dddd returns -1 and sets _eeee_rrrr_rrrr_nnnn_oooo to _EEEE_AAAA_GGGG_AAAA_IIII_NNNN.
If _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY and _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK are clear, _rrrr_eeee_aaaa_dddd blocks until data is
written to the pipe or the pipe is closed by all processes that had
opened the pipe for writing.
When attempting to read a file associated with a terminal or slave pty
that has no data currently available:
If _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY is set, _rrrr_eeee_aaaa_dddd returns 0.
If _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK is set, _rrrr_eeee_aaaa_dddd returns -1 and sets _eeee_rrrr_rrrr_nnnn_oooo to _EEEE_AAAA_GGGG_AAAA_IIII_NNNN.
If _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY and _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK are clear, _rrrr_eeee_aaaa_dddd blocks until data becomes
available.
When attempting to read a file associated with a master pty or any other
stream that is not a pipe or FIFO, or terminal, and that has no data
currently available:
If _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY or _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK is set, _rrrr_eeee_aaaa_dddd returns -1 and sets _eeee_rrrr_rrrr_nnnn_oooo to
_EEEE_AAAA_GGGG_AAAA_IIII_NNNN.
If _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY and _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK are clear, _rrrr_eeee_aaaa_dddd blocks until data becomes
available.
When attempting to read from a regular file in a DMAPI file system, if
the DMAPI application will take a considerable time to make the file data
available:
If _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY or _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK is set, _rrrr_eeee_aaaa_dddd returns -1 and sets _eeee_rrrr_rrrr_nnnn_oooo to
_EEEE_AAAA_GGGG_AAAA_IIII_NNNN.
If _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY and _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK are clear, _rrrr_eeee_aaaa_dddd sleeps until the the
DMAPI application has made the file data available.
_EEEE_DDDD_EEEE_AAAA_DDDD_LLLL_KKKK The _rrrr_eeee_aaaa_dddd was going to go to sleep and cause a deadlock to
occur.
_EEEE_FFFF_AAAA_UUUU_LLLL_TTTT _b_u_f points outside the allocated address space.
_EEEE_IIII_NNNN_TTTT_RRRR A signal was caught during the _rrrr_eeee_aaaa_dddd or _rrrr_eeee_aaaa_dddd_vvvv system call
and no bytes had been read.
_EEEE_IIII_NNNN_VVVV_AAAA_LLLL Attempted to read from a stream linked to a multiplexor.
_EEEE_IIII_NNNN_VVVV_AAAA_LLLL _f_i_l_d_e_s has _OOOO______DDDD_IIII_RRRR_EEEE_CCCC_TTTT or _FFFF_DDDD_IIII_RRRR_EEEE_CCCC_TTTT set and either the buffer
alignment, current file pointer alignment or read request
size is not valid for direct I/O. See also _FFFF______DDDD_IIII_OOOO_IIII_NNNN_FFFF_OOOO on
_ffff_cccc_nnnn_tttt_llll(2).
_EEEE_IIII_OOOO A physical I/O error has occurred, or the process is in a
background process group and is attempting to read from
its controlling terminal, and either the process is
ignoring or blocking the _SSSS_IIII_GGGG_TTTT_TTTT_IIII_NNNN signal or the process
group of the process is orphaned.
_EEEE_IIII_OOOO _f_i_l_d_e_s is open to a device that is in the process of
closing.
_EEEE_IIII_OOOO _f_i_l_d_e_s has _OOOO______DDDD_IIII_RRRR_EEEE_CCCC_TTTT or _FFFF_DDDD_IIII_RRRR_EEEE_CCCC_TTTT set and the number of bytes
requested by _rrrr_eeee_aaaa_dddd or _rrrr_eeee_aaaa_dddd_vvvv is greater than the number of
bytes between the current file pointer position and end of
file.
_EEEE_NNNN_OOOO_LLLL_CCCC_KKKK The system record lock table was full, so the _rrrr_eeee_aaaa_dddd or
_rrrr_eeee_aaaa_dddd_vvvv could not go to sleep until the blocking record lock
was removed.
_EEEE_NNNN_XXXX_IIII_OOOO The device associated with _f_i_l_d_e_s is a block special or
character special file and the value of the file pointer
is out of range.
_EEEE_SSSS_PPPP_IIII_PPPP_EEEE _p_r_e_a_d or _p_r_e_a_d_6_4 was called on a file incapable of
seeking.
In addition, _rrrr_eeee_aaaa_dddd_vvvv may return one of the following errors:
_EEEE_FFFF_AAAA_UUUU_LLLL_TTTT _i_o_v points outside the allocated address space.
_EEEE_IIII_NNNN_VVVV_AAAA_LLLL _i_o_v_c_n_t was less than or equal to 0 or greater than
_{{{{_IIII_OOOO_VVVV______MMMM_AAAA_XXXX_}}}}. _{{{{_IIII_OOOO_VVVV______MMMM_AAAA_XXXX_}}}} is the maximum number of _iiii_oooo_vvvv_eeee_cccc
structures that one process has available for use with
_rrrr_eeee_aaaa_dddd_vvvv. The value _{{{{_IIII_OOOO_VVVV______MMMM_AAAA_XXXX_}}}} can be obtained from a call to